using System;
using Unity.VisualScripting;
using UnityGameFramework.Runtime;

namespace LS.UGFUnits
{
    public class HideEntityLogic : EntityUnit
    {
        [DoNotSerialize]
        public ValueInput EntityLogic { get; set; }
        protected override void Definition()
        {
            base.Definition();
            EntityLogic = ValueInput<EntityLogic>(nameof(EntityLogic));
            Requirement(EntityLogic, Input);
        }

        protected override ControlOutput In(Flow flow)
        {
            EntityLogic entity = flow.GetValue<EntityLogic>(EntityLogic);
            Target?.HideEntity(entity.Entity);
            return base.In(flow);
        }
    }
}